home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
-
- # buff is the name of the buffer file in which to store a
- # temporary copy of the mail header
- buff=/tmp/.notify.glenn.buffer
-
- # copy the first screenful of the mail message to the buffer
- # for later perusal.
- head -24 > $buff
-
- #######################################################
- # Test for conditions that make us not want to play a sound and exit if such
- # conditions are found.
-
- # Don't make sounds if next-icon@ is in the 'To:' line.
- if grep '^To:' | grep '[Nn][Ee][Xx][Tt]-[Ii][Cc][Oo][Nn]@' < $buff > /dev/null;
- then
- rm $buff
- exit 0
- fi
-
- # Don't make sounds if next-icon@ is in the 'CC:' line.
- if grep '^[Cc][Cc]:' | grep '[Nn][Ee][Xx][Tt]-[Ii][Cc][Oo][Nn]@' < $buff > /dev/null;
- then
- rm $buff
- exit 0
- fi
-
- ########################################################
- #If the shell gets this far, play the sound.
- cd ~gbrown/Library/Sounds
- /usr/local/bin/ifonconsole gbrown '/usr/bin/sndplay Glenn.snd'
- rm $buff
- exit 0
-